/*
 * servermainframe.h
 *
 *  Created on: 2012-6-25
 *      Author: epmm
 */

#ifndef SERVERMAINFRAME_H_
#define SERVERMAINFRAME_H_

#include "object.h"
class CMainframe: public CObject
{
protected:
	string m_strGroupId;
	CConfig m_config;
	connection m_DBConn;

	CThreadMutex m_ResultMutex;
	CThreadPool m_ThreadPool;

public:
	CMainframe();
	virtual ~CMainframe();

DECLARE_DYNCREATE(CMainframe)

protected:
	int ParseDBStr(const char* sSrc, string& user, string& pwd,
			string& service_name);

public:
	virtual int InitSys(int argc, char **argv);

	virtual int InitLog();

	virtual int InitDB();

	virtual int InitConfig(const char* cfgfile);

	virtual int InitMsg();

	virtual int InitSocket();

	virtual int process();

	virtual int process(const char* pReqstr, string& Response);
};

#endif /* SERVERMAINFRAME_H_ */
